package com.erp.erp_servers.Billing.impl;

import com.erp.erp_dao.Billing.BillingDetailDao;
import com.erp.erp_entitys.Billing.entity.BillingDetailEntity;
import com.erp.erp_servers.Billing.BillingDetailService;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * @author zjk
 * @version 1.0
 * @description
 * @date 2021/1/16/016 23:05
 */
@Service
public class BillingDetailServiceImpl implements BillingDetailService {

    private final BillingDetailDao billingDetailDao;

    public BillingDetailServiceImpl(BillingDetailDao billingDetailDao) {
        this.billingDetailDao = billingDetailDao;
    }

    @Override
    public Integer delete(List<Integer> ids) {
        return billingDetailDao.deleteByPrimaryKey(ids);
    }

    @Override
    public Integer insertBillingDetailEntity(BillingDetailEntity billingDetailEntity) {
        return billingDetailDao.insertBillingDetailEntity(billingDetailEntity);
    }

    @Override
    public List<BillingDetailEntity> selectByBillingDetailBillingId(Integer billingId) {
        return billingDetailDao.selectByBillingDetailBillingId(billingId);
    }

    @Override
    public Integer updateBillingDetailInvalid(Integer valid, List<Integer> ids) {
        return billingDetailDao.updateBillingDetailInvalid(valid,ids);
    }

    @Override
    public Integer updateBillingDetailInvalidByBillingId(Integer valid, Integer[] ids) {
        return billingDetailDao.updateBillingDetailInvalidByBillingId(valid,ids);
    }

    @Override
    public int updateByBillingDetail(BillingDetailEntity billingDetail) {
        return billingDetailDao.updateByBillingDetail(billingDetail);
    }

    @Override
    public List<BillingDetailEntity> selectByBillingId(Integer billingId) {
        return billingDetailDao.selectByBillingId(billingId);
    }

    @Override
    public Integer findBillingDetailByParam(Integer sourceType,Integer invoiceType,String exportContractNo,String purchaseOrderCode, String productCode) {
        return billingDetailDao.findBillingDetailByParam(sourceType,invoiceType,exportContractNo,purchaseOrderCode,productCode);
    }

    @Override
    public Integer findBillingDetailByParamBillExchange(String contractNo, String invoiceNo, String productCode) {
        return billingDetailDao.findBillingDetailByParamBillExchange(contractNo,invoiceNo,productCode);
    }
}
